﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace GUI
{
    public partial class frmHoaDon : Form
    {
        public frmHoaDon()
        {
            InitializeComponent();
        }

        private void frmHoaDon_Load(object sender, EventArgs e)
        {
            List<HoaDonInfo> ds = new List<HoaDonInfo>();
            ds = HoaDonBUS.LayDanhSachHoaDon();
            for (int i = 0; i < ds.Count; i++)
            {
                double totalHours = Math.Round((ds[i].NgayKetThuc - ds[i].NgayBatDau).TotalHours,0);
                dgvHoaDon.Rows.Add(i + 1, ds[i].Phong.Tenphong, totalHours, ds[i].DonGia, totalHours*ds[i].DonGia);
            }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
